<!--
 * @Author: MuQuanyu(MQy)
 * @Date: 2025-10-17 09:19:00
 * @LastEditTime: 2025-10-17 09:43:36
 * @email: muquanyu@outlook.com
-->
<template>

  <el-popconfirm :hide-after="0" icon-color="red" class="box-item" title="确定要删除么？" placement="left">
    <template #reference>
      <el-button class="btn-loading-box" type="danger" link :disabled="loading" v-loading="loading">删除</el-button>
    </template>
    <template #actions="{ confirm, cancel }">
      <el-button size="small" @click="cancel">取消</el-button>
      <el-button type="danger" size="small" @click="handleDelete(rowData)">
        确定
      </el-button>
    </template>
  </el-popconfirm>

</template>

<script setup lang="ts">
const props = defineProps({
  loading: Boolean,
  rowData: Object
})
const emits = defineEmits(['handle-delete'])
const handleDelete = (rowData: any) => {
  emits('handle-delete', rowData)
}
</script>

<style lang="scss" scoped>
.btn-loading-box {
  ::v-deep(.el-loading-mask .el-loading-spinner) {
    transform: scale(0.7) !important;
    margin-right: 15px !important;
  }
}
</style>
